home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 15009 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: news.cern.ch!danpop
  2. From: danpop@mail.cern.ch (Dan Pop)
  3. Newsgroups: cs.forum,cuhk.se.3420,comp.lang.c
  4. Subject: Re: Help: a very segmentation fault!
  5. Date: 16 Apr 96 18:03:28 GMT
  6. Organization: CERN European Lab for Particle Physics
  7. Message-ID: <danpop.829677808@news.cern.ch>
  8. References: <4ki7gu$bgc@eng_ser1.erg.cuhk.hk> <4kinqm$hnt@eng_ser1.erg.cuhk.hk> <4kiptc$ih5@eng_ser1.erg.cuhk.hk> <4kisn3$jbi@eng_ser1.erg.cuhk.hk>
  9. NNTP-Posting-Host: ues5.cern.ch
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=US-ASCII
  12. Content-Transfer-Encoding: 7bit
  13. X-Newsreader: NN version 6.5.0 #7 (NOV)
  14.  
  15. In <4kisn3$jbi@eng_ser1.erg.cuhk.hk> mfchan@cs.cuhk.hk (I'm a good man) writes:
  16.  
  17. >NULL = '\0' = 0. Defined in stdio.h or stdlib.h
  18.  
  19. You might be a good man, but this doesn't prevent you from being an
  20. ignorant man, as well :-)
  21.  
  22. It is true that '\0' and 0 are the same.  They both have the same type and
  23. value.  It is also true that 0 can be always used instead of NULL, but
  24. the reciprocal is not necessarily true.  Proof:
  25.  
  26.     cnwgs1:~ 1> grep NULL /usr/include/stdio.h
  27.     #ifndef NULL
  28.     #define NULL    ((void *)0)
  29.  
  30. BTW, NULL is defined in <locale.h>, <stddef.h>, <stdio.h>, <stdlib.h>,
  31. <string.h> and <time.h>.
  32.  
  33. Dan
  34. --
  35. Dan Pop
  36. CERN, CN Division
  37. Email: danpop@mail.cern.ch 
  38. Mail:  CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland
  39.